#coding:utf-8
from analysis.core.db import db

class dbNoUrl(db):
    def getRows(self,username):
        self.cursor.execute("select count(*) from monitorurl where username=%s and type='"+self.type+"'",[username])
        if self.cursor.fetchone()[0]<1:
            return []
        self.cursor.execute("select site,searchword,title,url,content,pubtime,fetchtime from news where searchword in (select keyword from keywords where username=%s) and url not in (select contenturl from "+self.table+" where username=%s)",[username,username])
        return self.cursor.fetchall()